﻿//********************************************************************************//
//创建日期：<创建日期，2016-03-14>
//创建作者：<郭登杰，guodengjie@shanghai3h.com>
//功能说明：发票库存Model
//********************************************************************************//
using System;
using System.Collections.Generic;
using YXYLCommon;
using System.Data;

namespace Entity
{
    [Serializable]
    /// <summary>
    /// 发票库存
    /// </summary>
    public class YSZWFaPiaoKC : BaseModel
    {
        public YSZWFaPiaoKC()
        {
          
        }

        public int I_XT { get; set; }

        public int ID { get; set; }

        public string S_QISHIHM { get; set; }

        public string S_JIESHUHM { get; set; }

        public int I_SHULIANG { get; set; }

        //public string S_DANGQIANQSHM { get; set; }

        public int I_SHENGYUSL { get; set; }

        public int I_JLZT { get; set; }

        public int I_TYPE { get; set; }

        public string S_TYPE { get; set; }

        public int I_LINGYONGSL { get; set; }

        public string S_RUKUR { get; set; }

        public DbDateTime D_RUKURQ { get; set; }

        public override BaseModel ToObject(System.Data.DataRow row)
        {
            this.IsExists = true;
            this.I_XT = Convert.ToInt32(row["I_XT"]);
            this.ID =Convert.ToInt32(row["ID"]);
            this.S_QISHIHM = Convert.ToString(row["S_QISHIHM"]);
            this.S_JIESHUHM = Convert.ToString(row["S_JIESHUHM"]);
            this.I_SHULIANG = Convert.ToInt32(row["I_SHULIANG"]);
            this.I_SHENGYUSL = Convert.ToInt32(row["I_SHENGYUSL"]);
            this.I_JLZT = Convert.ToInt32(row["I_JLZT"]);
            this.I_TYPE = Convert.ToInt32(row["I_TYPE"]);
            this.S_TYPE = Convert.ToString(row["S_TYPE"]);
            this.I_LINGYONGSL = Convert.ToInt32(row["I_LINGYONGSL"]);
            this.S_RUKUR = Convert.ToString(row["S_RUKUR"]);
            this.D_RUKURQ = DbDateTime.Parse(row["D_RUKURQ"]);
            return this;
        }
    }
    public class DALYSZWFaPiaoKC : BaseDAL
    {
        public DALYSZWFaPiaoKC()
        {

        }
        protected override void fillSaveProc(BaseModel model)
        {
            //YS_ZW_FAPIAOKC obj = (YS_ZW_FAPIAOKC)model;
        }


        public DbCmdResult Save(YS_ZW_FAPIAOKC obj)
        {
            //dbProc.Init("P_YSZW_FAPIAORK");
            return CommonService.Ini().ExcuteProcOracle(dbProc);
        }

        public List<YSZWFaPiaoKC> Get(int xt,int? type)
        {
            dbProc.Init("P_YSZW_FAPIAOKCHQ");
            dbProc.AddParameter("V_XT", xt);
            dbProc.AddParameter("V_TYPE",type);
            return CommonService.Ini().GetList<YSZWFaPiaoKC>(dbProc);
        }
    }

}